<?php

namespace App\Console\Commands;

use App\Models\FinishProduct;
use App\Models\OrderLogistics;
use Illuminate\Console\Command;

class Demo extends Command
{
    /**
     * The name and signature of the console command.
     * php artisan command:updatedeliverytime
     * @var string
     */
    protected $signature = 'command:updatedeliverytime';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $list = OrderLogistics::where('logistics_status',3)->get();
        foreach($list as $k=>$v){
            $finish = FinishProduct::where('id',$v->finish_product_id)->first();
            $finish->delivery_time = $v->delivery_time;
            $finish->save();
        }
    }
}
